home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / bccapp.zip / GUIDE.DOC < prev    next >
Text File  |  1991-09-15  |  25KB  |  867 lines

  1.         (C) 1991 Vision Software, All Rights Reserved.
  2.  
  3.  
  4.          Address any correspondance to: 
  5.  
  6.                  Vision Software
  7.                  3408 Lansdown Drive
  8.                  Burlington, Ontario, Canada
  9.                  L7M-1V1
  10.  
  11.          In addition, I may be reach through the following electronic
  12.     networks:
  13.  
  14.                  GEnie:      P.CALVIN
  15.                  UseNet:     phil.calvin@rose.uucp
  16.  
  17.  
  18.      APPLICATIONS DEVELOPMENT LIBRARY
  19.  
  20.  
  21.  
  22.  
  23.             This library was developed in order to provide serious and
  24.      aspiring C++ programmers with an efficient and portable means to
  25.      develop data-manipulating applications.  With this in mind, we have
  26.      attempted to provide services that allow for the creation of an
  27.      effective user interface, objects that allow for organized and safe
  28.      user input, and finally, indexed record management to control this
  29.      input.
  30.  
  31.  
  32.  
  33.      DISCLAIMER
  34.  
  35.  
  36.  
  37.             Although extensive testing has been performed in an effort to
  38.      eliminate errors, the possiblity for errors always remains.  This
  39.      library is provided in the hope that it will be useful, but without
  40.      any warranty of any kind.  By using this library, you agree to waive
  41.      all claims for damage (however caused) against Vision Software.
  42.  
  43.  
  44.     LICENSE
  45.  
  46.  
  47.          I developed this library in order to avoid languages like 
  48.     Clipper/dBase for simple projects.  It is FREE software.  I
  49.     encourage programmers to distribute the library (including source)
  50.     freely.  The only restriction I place on its' distribution is that
  51.     you may NOT sell the library (other than nominal distribution costs).
  52.     You may sell software that was developed using the library.  In this
  53.     case, I would appreciate receiving a note regarding your software and
  54.     its' contents.  (This is just a request for my own information, not 
  55.     required).  You may also distribute this software (Source Include) 
  56.     with applications that you have developed.
  57.  
  58.  
  59.      HUNGARIAN
  60.  
  61.  
  62.  
  63.             Each variable and function within this library is named according
  64.      to the "Hungarian" naming convention.  Briefly, Hungarian provides
  65.      rules that are used in order to "TYPE" variables.  Each variable is
  66.      made of 3 parts (prefix,tag and qualifier).  Of these, only the TAG is
  67.      always present, it is the type of the variable.  The prefix is used to
  68.      modify that type (i.e pointer to X, count of X).  The Qualifier is
  69.      used to distinguish variables of the same type.  Some examples of
  70.      hungarian variables are as follows:
  71.  
  72.                      sz      // Base type, Null terminated string
  73.                      csz     // Counter of strings.
  74.                      ch      // Character
  75.                      pch     // Pointer to a character
  76.                      rgch    // Array of characters
  77.                      fError  // Boolean.  fTrue if ERROR
  78.  
  79.             The following tags are used for the classes within this library:
  80.  
  81.                      DATABASE dtb;
  82.                      REPORT rpt;
  83.                      EDIT edt;
  84.                      BATCH bat;
  85.                      WINDOW wnd;
  86.                      POPUP pop;
  87.                      DIALOG dial;
  88.                      PULLDOWN pull;
  89.                      SCROLL scl;
  90.                      VSCROLL vscl;
  91.  
  92.  
  93.      USERS GUIDE
  94.  
  95.  
  96.  
  97.             This guide is meant to provide ADL users with an outline of the
  98.      techniques needed in order to utilize the various (public) classes.
  99.      It is assumed the reader is familiar with C++, as such, we will not
  100.      explore the features C++ that allow the creation of this library.  In
  101.      addition, there is little or no discussion relating to the support
  102.      classes that the user generally has no need (or reason) to access
  103.      directly.
  104.  
  105.  
  106.      DATABASE
  107.  
  108.  
  109.             The ability to save and recall information lies at the heart of
  110.      applications programming.  Without being able to store information
  111.      over time, computers would be little more than expensive calculators.
  112.      Unfortunately, data manipulation using traditional systems-oriented
  113.      language is quite difficult.  On the other hand, while the so-called
  114.      "applications" languages provide excellent services to manipulate
  115.      data, efficiency in other areas is not generally available.
  116.  
  117.  
  118.             With the ADL, we provide an efficient and simple to use system
  119.      that allows us to manipulate C++ structures.  In addition to providing
  120.      all required header information, inheritance provides us with a way of
  121.      "typing" those records that may be manipulated through the DATABASE.
  122.      With this additional feature, the compiler, and (perhaps more
  123.      importantly) the user is able to quickly assert which objects are used
  124.      for storage.
  125.  
  126.  
  127.             In order to create an object that may be used with DATABASE,
  128.      simply derive it from DBASE.  With this, all required information is
  129.      available to the system.
  130.  
  131.  
  132.             Finally, all functions (with the exception of FGotoSz) will
  133.      perform normally without opening any index files.
  134.  
  135.  
  136.      DESCRIPTION
  137.  
  138.      DATABASE(*pdb,cchRec,szFile,fCreate=fFalse)
  139.  
  140.      Summary:  Constructor simply initializes the database
  141.                   system.  If fCreate, the file is created if not
  142.                   found.
  143.  
  144.      CID CidIndexOn(szFileName,*pchKey,cchKey);
  145.  
  146.      Summary:  Creates/Opens an index file for the current
  147.                   database.  The key for the index file will be
  148.                   cchKey bytes at pchKey.  The created index then
  149.                   becomes the currently active index.
  150.  
  151.      BOOL FIndexTo(cid);
  152.  
  153.      Summary:  Changes the active index to cid.  The database
  154.                   will then be initialized to the first record (if
  155.                   available) for the new index.
  156.  
  157.      BOOL FGotoSz(sz,fClose = fFalse)
  158.  
  159.      Summary:  Based on the currently active index, FGotoSz()
  160.                   searches the database for the first key to match.
  161.                   Answers fFalse if the record cannot be found.
  162.                   
  163.      BOOL FMark()
  164.  
  165.      Summary:  Marks the current record within the database.
  166.                   
  167.      BOOL FGotoMark()
  168.  
  169.      Summary:  Goes to the previouslyl established mark.
  170.  
  171.      BOOL FCreate()
  172.  
  173.      Summary:  Creates a new record in the database.  All indexes
  174.                   are automatically updated.  Will answer fFalse if
  175.                   some error occurred.
  176.  
  177.      BOOL FFirst()
  178.      BOOL FLast()
  179.      BOOL FNext()
  180.      BOOL FPrevious()
  181.  
  182.      Summary:  These functions provide services for sequential
  183.                   access throughout the file.  All will answer
  184.                   fFalse if the specific operation fails.
  185.  
  186.      BOOL FSave();
  187.      BOOL FDelete();
  188.  
  189.      Summary:  These functions will save and delete the current
  190.                   record.  NOTE: There is NO confirmation requested
  191.                   by the system.
  192.  
  193.      DBASE *PdbQuery();
  194.  
  195.      Summary:  Not frequently needed, this function will answer
  196.                   with the pointer to the database object being
  197.                   manipulated.  It is useful in the rare case that
  198.                   we have the DATABASE, but not the record object.
  199.  
  200.      SZ SzIndex(cid = cidNil);
  201.      CCH CchIndex(cid = cidNil);
  202.  
  203.      Summary:  Not frequently needed, these functions will answer
  204.                   with the address and length of the current index
  205.                   key.  If specified, we search the specified index
  206.                   key.
  207.  
  208.      Example:
  209.  
  210.      //
  211.      //  Simple exaple program.  Traverses database
  212.      //
  213.      #include <dbase.h>
  214.  
  215.      //
  216.      //  FOO is our object to manipulate.
  217.      //
  218.      class FOO : public DBASE
  219.         {
  220.         CHAR szKey[cchKeyMax];
  221.         };
  222.  
  223.      SomeFunction()
  224.         {
  225.         FOO foo;
  226.         DATABASE dtb(&foo,sizeof(foo),"filename",fTrue);
  227.         CID cid = dtb.CidIndexOn("filename",foo.szKey,cchKeyMax);
  228.  
  229.         //
  230.         //  Traverse the entire DATABASE
  231.         //
  232.         if (dtb.FFirst())
  233.           {
  234.           do  
  235.              {
  236.              OutputOrWhatever(foo);
  237.              }
  238.           while (dtb.FNext());
  239.           }
  240.         }
  241.  
  242.      REPORT GENERATION
  243.  
  244.  
  245.             Client reports, inventory lists, sales records.  Although
  246.      similar, traditional programming would require that each report be
  247.      written individually.  With C++, we may generate standard reports to
  248.      the screen or printer with ease.
  249.  
  250.  
  251.      DESCRIPTION
  252.  
  253.         REPORT(&rdtb);
  254.  
  255.      Summary:  Initializes the report.
  256.  
  257.     VOID Title(sz,al = alCentre);
  258.     
  259.      Summary:  Creates a title for the report.  The alignment of the title
  260.                is al (alLeft/alCentre/alRight)
  261.                
  262.      VOID Entry(col,sz,cch,szTitle = szNil);
  263.  
  264.      Summary:  Creates a field for the report.  The entry will be
  265.                   taken from sz for each record.  If desired, a
  266.                   title may be specified that will be placed at the
  267.                   top of each page.
  268.  
  269.      VOID SetFilterTo((*pfnFUse)(DBASE *pdb));
  270.  
  271.      Summary:  The report may be filtered in order to limit the
  272.                   records that are viewed.  pfnFUse must answer
  273.                   fTrue if the record is to be included.
  274.  
  275.      VOID Generate(fForward = fTrue,fPrinter = fFalse);
  276.  
  277.      Summary:  Creates the report.  Normally the report will
  278.                   traverse the Database forward and place the output
  279.                   to the screen.
  280.  
  281.  
  282.      USER INPUT
  283.  
  284.  
  285.             Complex user input may be simplified by dividing all required
  286.      information into "Fields".  These fields may then be designed to
  287.      accept specific data types.  By this technique, complex input
  288.      sequences (Such as entering client information) may be presented in an
  289.      effective manner that any user will understand.
  290.  
  291.  
  292.             The EDIT class provides the user with these very services.  Each
  293.      field may be individually validate using a variety of methods.  These
  294.      range from simple "picture" validation up to set validation.
  295.  
  296.  
  297.      DESCRIPTION
  298.  
  299.      EDIT(fConfirm = fFalse,szTitle = szNil);
  300.  
  301.      Summary:  Creation of the EDIT.  May specify a title for the
  302.                   window and whether the user should be queried
  303.                   before terminating.
  304.  
  305.      VOID Title(row,col,sz);
  306.  
  307.      Summary:  Title fields may be used to intersperse messages
  308.                   or information within the window that may not be
  309.                   modified.
  310.  
  311.      VOID Field(row,col,szMsg,sz,szPic,szHelp=szNil,szDefault=szNil);
  312.  
  313.      Summary:  Specifies an editable field for the user.  In this
  314.                   case, the picture is a NULL terminated string of
  315.                   pictures (ex: "XXX999").  The length of this
  316.                   string is used to determine the length of the
  317.                   field.  The following pictures are available:
  318.  
  319.                                 X- Any printable character
  320.                                 9- Digits
  321.                                 A- Upper case letters, any other char
  322.                                 a- Lower case letters, any other char
  323.                                 U- Upper case letters only
  324.                                 L- Lower case letters only
  325.                                 N- Upper case Letters, Numbers
  326.                                 n- Lower case Letters, Numbers
  327.  
  328.      VOID Field(row,col,szMsg,sz,ch,cch,szHelp=szNil,szDefault=szNil);
  329.  
  330.      Summary:  Specifies an editable field for the user.  The
  331.                   picture is the character ch, the length of the
  332.                   field is given by cch.
  333.  
  334.      VOID Field(row,col,szMsg,sz,cch,szHelp,cent,pent,centDefault);
  335.  
  336.      Summary:  Specifies an editable field for the user.  In
  337.                   order for the input to be valid, it must match an
  338.                   entry within the ENT (see POPUPs).  The length of
  339.                   the field is the length of the longest element of
  340.                   the ENT.
  341.  
  342.      VOID Read();
  343.  
  344.      Summary:  Starts the EDIT process.  Centers a window on the
  345.                   screen and activates the field editor.
  346.  
  347.      VOID Delimiters(chLeft='[',chRight=']');
  348.  
  349.      Summary:  Allows the programmer to change the default field
  350.                   delimiters.
  351.  
  352.  
  353.      BATCH USER INPUT
  354.  
  355.  
  356.             Combining EDIT with our DATABASE class, we have provided BATCH
  357.      user input.  With this, the user may (manually) enter lists of
  358.      information painlessly.  Such lists could include client lists,
  359.      inventory lists or whatever.
  360.  
  361.  
  362.             BATCH is publicly derived from EDIT.  As such, creation of fields
  363.      is identical.  By specifying one (or more) index fields, the system
  364.      will maintain ordering based upon those fields.  An IndexSelector may
  365.      be provided to allow the user to switch indexes during the edit.
  366.  
  367.  
  368.      DESCRIPTION
  369.  
  370.     BATCH(*pdb,cch,szFile,szTitle = szNil,(*pfnCreate)(DBASE *) = Nil);
  371.     BATCH(&rdtbOriginal,szTitle = szNil,(*pfnCreate)(DBASE *) = Nil);
  372.  
  373.      Summary:  Opens the DATABASE (creates if necessary) and
  374.                   initializes the EDIT.  pfnCreate is called before
  375.                   created a new record.
  376.  
  377.     VOID Index(row,col,szFile,szMsg,sz,chPic,cch,szHelp = "",szDefault = szNil);
  378.     VOID Index(row,col,cid,szMsg,chPic,szHelp = "",szDefault = szNil);
  379.  
  380.      Summary:  Create an index field.  All parameters are
  381.                   identical to EDIT field, with the exception of the
  382.                   index file name.  If the database was already opened,
  383.                   the user may provide the cid instead of the index file
  384.                   name.
  385.  
  386.      VOID IndexSelector(row,col,szMsg,cent,pent,centDefault = centNil);
  387.  
  388.      Summary:  Creates a field that the user may edit in order to
  389.                   change the active index file.  The library will
  390.                   Assert if this method is called more than once per
  391.                   object.
  392.  
  393.      //
  394.      //  Demo of Batch User Input
  395.      //
  396.      #include <batch.h>
  397.  
  398.      struct CLIENT : public DBASE
  399.         {
  400.         CHAR rgchName[30];
  401.         CHAR rgchAddr[30];
  402.         ...
  403.         }
  404.  
  405.      //
  406.      //  Create client lists..
  407.      //
  408.      VOID EditClient()
  409.         {
  410.         CLIENT cli;
  411.         BATCH bat(&cli,sizeof(cli),"clients","Edit Client Lists");
  412.  
  413.         //
  414.         //  Setup fields...
  415.         //
  416.         bat.Index(1,1,"clients","Name    :",cli.rgchName,'X',30);
  417.         bat.Field(3,1,"Address  :",cli.rgchAddr,'X',30);
  418.         ...
  419.  
  420.         //
  421.         //  And, execute read..
  422.         //
  423.         bat.Read()
  424.         }
  425.  
  426.  
  427.      WINDOWS
  428.  
  429.  
  430.             Used by nearly every public class, WINDOWs provides the
  431.      programmer with an opportunity to present complex information in an
  432.      organized, understandable fashion.
  433.  
  434.  
  435.      DESCRIPTION
  436.  
  437.      WINDOW(row1,col1,row2,col2,coFore,coBack,sz=szNil,fScroll=fFalse);
  438.      WINDOW();
  439.  
  440.      Summary:  A window may be created by specifying all
  441.                   dimensions and colours or none at all.  If none,
  442.                   the system default is used.
  443.  
  444.      VOID Open();
  445.      VOID Close();
  446.  
  447.      Summary:  Creates the window on screen, and conversely,
  448.                   removes it.
  449.  
  450.      VOID Move(row,col);
  451.  
  452.      Summary:  An opened window may be moved to any position on
  453.                   the screen.  If an attempt is made to move the
  454.                   window OFF the screen, the system will stop the
  455.                   window at the edge.
  456.  
  457.      VOID Cls();
  458.      VOID ClearRow(rowClear);
  459.      VOID ClearCol(colClear);
  460.  
  461.      Summary:  Clears the window or portions of it.
  462.  
  463.      VOID SetScrollCol(colLeft,colRight);
  464.      VOID SetScrollRow(rowTop,rowBottom);
  465.  
  466.      Summary:  Using these functions, the programmer may set
  467.                   individual scroll regions within each window.  The
  468.                   default is to scroll the entire window.
  469.  
  470.      VOID ScrollDrow(drow);
  471.      VOID ScrollDcol(dcol);
  472.  
  473.      Summary:  These functions provide the programmer with manual
  474.                   control over a windows scrolling.  Even if
  475.                   automatic scroll is turned off, these functions
  476.                   will perform normally.
  477.  
  478.      ROW RowQuery();
  479.      COL ColQuery();
  480.  
  481.      Summary:  These functions will answer with the current
  482.                   cursor position.
  483.  
  484.      VOID SetRowCol(row,col);
  485.  
  486.      Summary:  Manually adjust the cursor position.  The next
  487.                   output will take place here.
  488.  
  489.      VOID Say(sz,coFore = coError,coBack = coError);
  490.      VOID SayAt(row,col,sz,coFore=coError,coBack=coError);
  491.      VOID SayHot(row,col,sz,cch,coFore=coError,coBack=coError);
  492.      VOID SayCentered(row,sz,coFore=coError,coBack=coError);
  493.      VOID PutCh(ch,coFore=coError,coBack=coError);
  494.  
  495.      Summary:  These output routines may be used to output text
  496.                   to the (opened) windows.  Each method will update
  497.                   the cursor position after and scroll the window as
  498.                   necessary and desired.
  499.  
  500.  
  501.      HELP SYSTEM
  502.  
  503.  
  504.             Even the simplest program is useless if the user is unable to
  505.      determine the correct action.  For that reason, we provide a simple to
  506.      use help system.  The bottom row of the screen is off-limits to the
  507.      application.  It is instead used by the Help class to provide quick
  508.      help to the user.
  509.  
  510.  
  511.      DESCRIPTION
  512.  
  513.      HELP(sz);
  514.  
  515.      Summary:  To use the simple help system, create an object of
  516.                   type HELP.  With that, the bottom line of the
  517.                   screen will be updated.  Once the object is
  518.                   destroyed, the original message will return.
  519.  
  520.      VOID Replace(sz);
  521.  
  522.      Summary:  The help text may be adjust after construction as
  523.                   many times as necessary.
  524.  
  525.  
  526.      MENUS
  527.  
  528.  
  529.             Selection boxes are an effective technique that allows the
  530.      programmer to "prevent" user mistakes.  Our menu system is based upon
  531.      the following ENT structure.
  532.  
  533.  
  534.             In general, each selection box will be an array of ENTs.  These
  535.      structures include everything to describe an individual menu entry.
  536.      For each ENT to be valid, only the text for the menu entry needs to be
  537.      valid.  All other fields may be ignored if not needed.
  538.  
  539.      struct ENT
  540.         {
  541.         SZ sz;                    // Text for menu entry
  542.         CCH cchHotKey;            // Index into sz for Hotkey
  543.         VOID (*pfnFunction)(VOID);// Function for selected item
  544.         SZ szQuickHelp;           // Text at bottom row of the screen
  545.         CENT centNext;            // Number of entries in Sub-Menu
  546.         ENT *pentNext;            // Sub-Menu may be linked here
  547.  
  548.      POPUPS
  549.  
  550.  
  551.             The super class for our menu system is POPUPs.  Upon creation,
  552.      popups are fixed in size.  Their height will be exactly the size of
  553.      the number of Entries.  Thus, each option will be displayed when the
  554.      popup is on screen.
  555.  
  556.  
  557.             All classes that follow are derived from POPUP, as such, each
  558.      will have the functionality provided from within that super class.
  559.  
  560.  
  561.      DESCRIPTION
  562.  
  563.      POPUP(row,col,cent,pent,sz=szNil);
  564.  
  565.      Summary:  Initializes the popup.  The program will Assert if
  566.                   pent does not contain a valid address, or if cent
  567.                   is greater than the height of the screen.
  568.  
  569.      CENT CentGet();
  570.  
  571.      Summary:  Activates the menu.  The program answers with the
  572.                   number of the entry that was selected.  If the
  573.                   user ESCaped, centError is answered.  If that
  574.                   entry has a Sub-Menu, another popup is presented
  575.                   to the right of the original.  If the selected
  576.                   entry has a valid function address, that function
  577.                   is called before returning.
  578.  
  579.  
  580.      PULLDOWN MENU BARS
  581.  
  582.  
  583.             By linking together several POPUPs, the Pulldown manager provides
  584.      use with the traditional Pulldown menus.  The Menu bar is described as
  585.      an array containing the following information:
  586.  
  587.      struct BAR
  588.         {
  589.         SZ sz;                // Text for heading
  590.         CCH cchHotKey;        // Offset in sz for "HotKey"
  591.         CENT cent;            // Number of entries in menu
  592.         PENT pent;            // Array of menu entries.
  593.         };
  594.  
  595.      DESCRIPTION
  596.  
  597.      PULLDOWN(row,cbar,*pbar);
  598.  
  599.      Summary:  Creates a pulldown bar to be displayed at row
  600.                   (Usually 1).  The program will Assert if pbar does
  601.                   not contain a valid address.
  602.  
  603.      VOID ShowBar();
  604.  
  605.      Summary:  Displays the Menu bar at the prescribed row.
  606.  
  607.      CD CdGet();
  608.  
  609.      Summary:  Activates the menu-bar.  The program will answer
  610.                   with the key that caused the system to return.
  611.                   ESC terminates without selection.  Any other key
  612.                   means a valid selection took place.
  613.  
  614.  
  615.      DIALOG BOXES
  616.  
  617.  
  618.             Dialog boxes are handy if the user is required to answer some
  619.      question.  Usually there will be two or three answers, the user simply
  620.      needs to select ONE of them.
  621.  
  622.  
  623.      DESCRIPTION
  624.  
  625.      DIALOG(sz,cent,pent);
  626.  
  627.      Summary:  Creates the dialog box.  Sz is the message to be
  628.                   presented.
  629.  
  630.      CENT CentGet();
  631.  
  632.      Summary:  Presents the dialog.  Again, centError is return
  633.                   if the user presses ESC.
  634.  
  635.  
  636.      SCROLL BOXES
  637.  
  638.  
  639.             Unlike regular POPUPs, the number of entries in a SCROLL box
  640.      exceeds that of the size.  Because of this, the selector scrolls up
  641.      and down as the user moves the cursor.
  642.  
  643.  
  644.      DESCRIPTION
  645.  
  646.      SCROLL(row,col,cent,pent,centMac,sz=szNil)
  647.  
  648.      Summary:  Creates a new scroll box.  This class is publicly
  649.                   derived from POPUP, as such, its' use is
  650.                   identical.
  651.  
  652.  
  653.      VIRTUAL SCROLL BOXES
  654.  
  655.  
  656.             Similar to Scroll Boxes, the number of entries within a Virtual
  657.      scroll box usually exceeds its' size.  In this case, the entries are
  658.      taken from the KEY fields within a database.  The number of entries
  659.      will be equal to the number of records within the database.
  660.  
  661.  
  662.      DESCRIPTION
  663.  
  664.      VSCROLL(row,col,centView,&rdtb,sz,cch,szTitle = szNil);
  665.  
  666.      Summary:  Creates a Virtual scroll box.  Again, this is
  667.                   publicly derived from POPUP.  Upon termination,
  668.                   the DATABASE will be left pointing to the selected
  669.                   record.
  670.  
  671.  
  672.      LIBRARY DECLARATIONS
  673.  
  674.  
  675.             These declarations are provided for reference only.  They contain
  676.      only public methods and are intended to reinforce the rest of this
  677.      manual.  For a complete reference, including all typedefs etc, please
  678.      refer to the files in the inc/ subdirectory.
  679. :
  680.      /*
  681.       * Public utility routines.
  682.       */
  683.      EXTERN BOOL FAskSz(SZ sz,SZ szHelp = szNil);  // Asking Yes/No
  684.      EXTERN VOID SaySz(SZ sz,SZ szHelp = szNil);   // Message to user
  685.      EXTERN VOID ErrorSz(SZ sz,SZ szHelp = szNil); // Error message to user
  686.      EXTERN CD CdInput(VOID);                      // Input Interface
  687.  
  688.      /*
  689.       * Global variables to provide run-time dimensions for the screen..
  690.       */
  691.      EXTERN ROW rowGlobalWindowBottom;
  692.      EXTERN COL colGlobalWindowRight;
  693.  
  694.      /*
  695.       *  Standard menu.  Usually appears first under "System" header
  696.       */
  697.      EXTERN ENT pentVision[];
  698.  
  699.      /*
  700.       * Context-sensitive help system
  701.       */
  702.      class HELP
  703.         {
  704.      public:
  705.         HELP(SZ sz);
  706.         ~HELP();
  707.         VOID Replace(SZ sz);
  708.         };
  709.  
  710.      /*
  711.       * Windowing system.
  712.       */
  713.      class WINDOW
  714.         {
  715.      public:
  716.         WINDOW(ROW row1,COL col1,ROW row2,COL col2,CO coFore,CO coBack,SZ
  717.                   sz=szNil,BOOL fScroll = fFalse);
  718.         WINDOW(VOID);
  719.         ~WINDOW(VOID);
  720.         VOID Draw(VOID);
  721.         VOID Open(VOID);
  722.         VOID Close(VOID);
  723.         VOID Move(ROW row,COL col);
  724.         ROW RowQuery(VOID);
  725.         COL ColQuery(VOID);
  726.         VOID Cls(VOID);
  727.         VOID ClearRow(ROW rowClear);
  728.         VOID ClearCol(COL colClear);
  729.         VOID ScrollDrow(ROW drow);
  730.         VOID ScrollDCol(COL dcol);
  731.         VOID SetScrollCol(COL colLeft,COL colRight);
  732.         VOID SetScrollRow(ROW rowTop,ROW rowBottom);
  733.         VOID SetRowCol(ROW row,COL col);
  734.         VOID Say(SZ sz,CO coFore = coError,CO coBack = coError);
  735.         VOID SayAt(ROW row,COL col,SZ sz,CO coFore = coError,CO coBack =
  736.                   coError);
  737.         VOID SayHot(ROW row,COL col,SZ sz,CCH cch,CO coFore = coError,CO
  738.                   coBack = coError);
  739.         VOID SayCentered(ROW row,SZ sz,CO coFore = coError,CO coBack =
  740.                   coError);
  741.         VOID PutCh(CHAR ch,CO coFore = coError,CO coBack = coError);
  742.         };
  743.  
  744.      /*
  745.       * Database.
  746.       */
  747.      class DATABASE : private ACCESS
  748.         {
  749.      public:
  750.         DATABASE(DBASE *pdb,CCH cchRecord,SZ szFileName,BOOL fCreateFile =
  751.                   fFalse);
  752.         ~DATABASE();
  753.         BOOL FSave();
  754.         BOOL FMark();
  755.         BOOL FGotoMark();
  756.         BOOL FDelete();
  757.         BOOL FFirst();
  758.         BOOL FLast();
  759.         BOOL FNext();
  760.         BOOL FPrevious();
  761.         BOOL FCreate();
  762.         BOOL FGotoSz(SZ sz,BOOL fMatchIfClose = fFalse);
  763.         BOOL FGotoRec(REC rec);
  764.         BOOL FIndexTo(CID cid);
  765.         CID CidIndexOn(SZ szFileName,CHAR *pchKey,CCH cchKey);  
  766.         DBASE *PdbQuery();
  767.         SZ SzIndex();
  768.         CCH CchIndex();
  769.         };
  770.  
  771.      /*
  772.       * Edit Class Specification..
  773.       */
  774.      class EDIT
  775.         {
  776.      public:
  777.         EDIT(BOOL fConfirm = fFalse,SZ sz = szNil);
  778.         ~EDIT();
  779.         VOID Read();
  780.         VOID Title(ROW row,COL col,SZ sz);
  781.         VOID Field(ROW row,COL col,SZ szMsg,SZ sz,SZ szPic,SZ szHelp =
  782.                   szNil,SZ szDefault = szNil);
  783.         VOID Field(ROW row,COL col,SZ szMsg,SZ sz,CHAR ch,CCH cch,SZ szHelp
  784.                   = szNil,SZ szDefault = szNil);
  785.         VOID Field(ROW row,COL col,SZ szMsg,SZ sz,CCH cch,SZ szHelp,CENT
  786.                   cent,PENT pent,CENT centDefault = centNil);
  787.         VOID Delimiters(CHAR chL='[',CHAR chR=']');
  788.         };
  789.  
  790.      /*
  791.       * Batch field editing.
  792.       */
  793.      class BATCH : public EDIT
  794.         {
  795.      public:
  796.         BATCH(DBASE *pdb,CCH cch,SZ szFile,SZ szTitle = szNil);
  797.         VOID Index(ROW row,COL col,SZ szFile,SZ szMsg,SZ sz,CHAR chPic,CCH
  798.                   cch,SZ szHelp = "");
  799.         VOID IndexSelector(ROW row,COL col,SZ szMsg,CENT cent,PENT pent,CENT
  800.                   centDefault = centNil);
  801.         };
  802.         
  803.      /*
  804.       *  Report Generation
  805.       */
  806.      class REPORT
  807.         {
  808.      public:
  809.         REPORT(DATABASE &rdtb);
  810.         ~REPORT();
  811.         VOID Entry(COL col,SZ sz,CCH cch,SZ szTitle = szNil);
  812.         VOID SetFilterTo(BOOL (*pfnFUse)(DBASE *pdb));
  813.         VOID Generate(BOOL fForward = fTrue,BOOL fPrinter = fFalse);
  814.         };
  815.  
  816.      /*
  817.       * Popup Superclass.  Base class for all menus
  818.       */
  819.      class POPUP
  820.         {
  821.      public:
  822.         POPUP(ROW row,COL col,CENT cent,PENT pent,SZ sz=szNil);
  823.         CENT CentGet();
  824.         };
  825.  
  826.      /*
  827.       * Scroll boxes
  828.       */
  829.      class SCROLL : public POPUP
  830.         {
  831.      public:
  832.         SCROLL(ROW row,COL col,CENT cent,PENT pent,CENT centView,SZ
  833.                   sz=szNil);
  834.         };
  835.  
  836.      /*
  837.       * Virtual scroll boxes
  838.       */
  839.      class VSCROLL : public SCROLL
  840.         {
  841.      public:
  842.         VSCROLL(ROW row,COL col,CENT centView,DATABASE &rdtb,SZ sz,CCH
  843.                   cch,SZ szTitle = szNil);
  844.         };
  845.  
  846.      /*
  847.       * The pulldown system uses each menu as a special case of the
  848.       * Popup system we just declared...
  849.       */
  850.      class PULLDOWN : private POPUP
  851.         {
  852.      public:
  853.         PULLDOWN(ROW row,CBAR cbar,BAR *pbar);
  854.         VOID ShowBar();
  855.         CD CdGet();
  856.         };
  857.  
  858.      /*
  859.       * Dialog boxes.
  860.       */
  861.      class DIALOG : public POPUP
  862.         {
  863.      public:
  864.         DIALOG(SZ sz,CENT centMax,PENT pent);
  865.         ~DIALOG();
  866.         };
  867.